<?php

/**
 * This is the model class for table "language_article".
 */

require_once dirname(__FILE__) . '/base/LanguageArticleBase.php';
Yii::import('Article.models.Article');
class LanguageArticle extends LanguageArticleBase
{
    protected function beforeSave()
    {
        $this->alias = Utility::createAlias($this, $this->title);
        return parent::beforeSave();
    }
    
    public function relations()
    {
        // NOTE: you may need to adjust the relation name and the related
        // class name for the relations automatically generated below.
        return array(
            'article' => array(self::BELONGS_TO, 'Article','article_id','joinType'=>'INNER JOIN'),
        );
    }
}